package com.teamone.mobilewatch;

import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

/**
 * 
 * User Settings screen to view/edit/save preferences
 * 
 */
public class SettingsPreferenceActivity extends PreferenceActivity {
	private static final String TAG = "SettingsPreferenceActivity";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);

	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {

		case R.id.edit:
			startActivity(new Intent(this, EditActivity.class));
			return true;

		case R.id.details:
			startActivity(new Intent(this, DetailsActivity.class));
			return true;

		case R.id.admin:
			startActivity(new Intent(this, AdminActivity.class));
			return true;

		default:
			break;
		}

		return false;
	}


}
